package com.alibaba.datax.plugin.reader.aliyunslsreader;

import com.alibaba.datax.common.spi.ErrorCode;
/**
 * Created by dancoder on 2022.01.08
 */
public enum AliyunSlsReaderErrorCode implements ErrorCode {

    RUNTIME_EXCEPTION("AliyunSlsReader-00", "运行时异常"),
    SLS_READER_CONFIG_ERROR("AliyunSlsReader-01", "AliyunSlS配置异常"),
    CONFIG_INVALID_EXCEPTION("AliyunSlsReader-02", "参数配置错误"),
    NOT_SUPPORT_TYPE("AliyunSlsReader-03", "不支持的类型"),
    CAST_VALUE_TYPE_ERROR("AliyunSlsReader-04", "无法完成指定类型的转换"),
    SECURITY_EXCEPTION("AliyunSlsReader-05", "缺少权限"),
    ILLEGAL_VALUE("AliyunSlsReader-06", "值错误"),
    REQUIRED_VALUE("AliyunSlsReader-07", "必选项"),
    NOT_EXIST_LOGSTORE_EXCEPTION("AliyunSlsReader-08", "不存在的logstore");

    private final String code;
    private final String description;

    private AliyunSlsReaderErrorCode(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getDescription() {
        return this.description;
    }

    @Override
    public String toString() {
        return String.format("Code:[%s], Description:[%s].", this.code, this.description);
    }
}
